<?php
	session_start();
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Won-松的趣味分享</title>
	<link rel="stylesheet" type="text/css" href="../css/bass.css"/>
	<link rel="stylesheet" type="text/css" href="../css/funstyle.css"/>
</head>
<body>
	<?php
		error_reporting(E_ERROR | E_WARNING | E_PARSE);
		$s = $_SESSION["is_login"];
		if ($s=='ok') {
	?>
	<div class="form">
		<div class="head"><b>分类</b></div>
		<table>
		<a href="catalog_add.php">添加</a>
			<tr>
				<th>id</th>
				<th>分类</th>
				<th>操作</th>
			</tr>
		<?php
			include("../function.php");
			$conn = conn();
			$sql = mysqli_query($conn,"select * from cata_log");
			while ($catalog = mysqli_fetch_assoc($sql)) {
		?>
			<tr>
				<td><?=$catalog['id']?></td>
				<td><?=$catalog['class']?></td>
				<td>
					<a href="catalog_edit.php?id=<?php echo $catalog['id']?>">编辑</a>
					<a href="catalog_del.php?id=<?php echo $catalog['id']?>">删除</a>
				</td>
			</tr>
		<?php
			}

		?>
			
		</table>
	<?php
		}
	?>
	</div>
</body>
</html>